package com.chunayev.numerology.gui.table;

import com.chunayev.numerology.util.Constants;

/**
 * @author Sergey Chunayev
 */
public class TablePositionCalculator {
    
    public static final int calculateOrdinal(final int row, final int column) {
        final int count = Constants.ROW_COUNT;
        final int position = (count - 1) * (count - row) + column - row - 1;
        return position;
    }
    
    public static final int calculatePosition(final int row, final int column) {
        return calculateOrdinal(row, column) + 1;
    }
}
